<template>
  <van-nav-bar right-text="按钮" left-arrow fixed>
    <div slot="left">
      <form action="/">
      <van-search placeholder="请输入搜索关键词" v-model="value" background="#d43d3d" @search="onSearch" />
      </form>
    </div>
    <div slot="right">
      <van-icon name="photograph" color="#fff" size="25px" />
    </div>
  </van-nav-bar>
</template>
<script>
export default {
  data: () => ({
    value: ''
  }),
  created() {},
  methods: {
    onSearch(value) {
      // console.log(this.$refs.onSearchF)
      // this.$emit('searchInfo', value)
      this.$parent.onSearchF(value)
      // console.log(value)
    }
  }
}
</script>
<style lang="less" stope>
.van-nav-bar {
  background-color: #d43d3d !important;
  .van-search {
    padding:6px 12px;
    .van-field__control{
      width:230px;
    }
    .van-icon-search {
      color: #000;
    }
    .van-search__content {
      border-radius: 5px;
    }
  }
}
</style>
